package main

import "fmt"

type Celsius float64
type Fahrenheit float64

const (
	AbsoluteZeroC Celsius = -273.15
	FreezingC     Celsius = 0
	BollingC      Celsius = 100
)

func CToF(c Celsius) Fahrenheit {
	return Fahrenheit(c*9/5 + 32)
}
func FToC(f Fahrenheit) Celsius {
	return Celsius((f - 32) * 5 / 9)
}

func (c Celsius) String() string    { return fmt.Sprintf("%g℃", c) }
func (f Fahrenheit) String() string { return fmt.Sprintf("%g℃", f) }
func (c Celsius) GoString() string {
	return c.String()
}
func (f Fahrenheit) GoString() string {
	return f.String()
}

func init() {
	fmt.Println("执行本go程序的init函数")
}

func main() {
	fmt.Printf("%g\n", BollingC-FreezingC)
	bollingF := CToF(BollingC)
	fmt.Println(bollingF - CToF(FreezingC))
	var c Celsius
	var f Fahrenheit
	{
		fmt.Println(c == 0)
		fmt.Println(f >= 0)
	}
	fmt.Println(c == Celsius(f))

	x := "hello"
	for _, x := range x {
		x := x + 'A' - 'a'
		fmt.Printf("%c", x)
	}
}
